#include "helppage.h"
#include "player/gamemain.h"
#include "startpage.h"
using namespace cocos2d;

CCScene *HelpPage::scene()
{
	CCScene *scene = NULL;
	do 
	{
		scene = CCScene::create();
		CC_BREAK_IF(!scene);
		HelpPage *help_page = HelpPage::create();
		scene->addChild(help_page);
	} while (0);
	return scene;
}
bool HelpPage::init()
{
	setKeypadEnabled(true);
	CCSprite * help = CCSprite::createWithSpriteFrameName("help.jpg");
	help->setScaleX(GameMain::kScaleX);
	help->setScaleY(GameMain::kScaleY);
	help->setAnchorPoint(ccp(0,0));
	help->setPosition(ccp(0,0));
	addChild(help);
	CCSprite *back_sprite = CCSprite::createWithSpriteFrameName("back.png");

	CCMenuItemSprite * back_button = CCMenuItemSprite::create(back_sprite,back_sprite,this,menu_selector(HelpPage::back));
	back_button->setPosition(350*GameMain::kScaleX,-200*GameMain::kScaleY);
	CCMenu *menu = CCMenu::create();
	menu->addChild(back_button);
	addChild(menu);
	return true;
}
void HelpPage::back(cocos2d::CCObject *pSender)
{
	CCScene *pScene = StartPage::scene();
	CCDirector::sharedDirector()->replaceScene(pScene);
}
void HelpPage::keyBackClicked()
{
	CCDirector::sharedDirector()->popScene();
}